package router

import (
	"fmt"
	"git.mycaigou.com/gfyx/micro-gfyx-bigdata-service/http_server/controller"
	"git.mycaigou.com/gfyx/micro-gfyx-bigdata-service/infrastructure/di"

	"github.com/gin-gonic/gin"
)

// RegisterHealthRouters 检测
func RegisterHealthRouters(g *gin.RouterGroup) {
	//new(controller.HealthController).RegisterRouter(g)
	c := di.InjectInstance()
	err := c.Invoke(func(
		healthController *controller.HealthController,
	) {
		healthController.RegisterRouter(g)
	})
	fmt.Printf("RegisterHealthRouters err: %+v\n", err)
}

func RegisterBigdataRouters(g *gin.RouterGroup) {
	c := di.InjectInstance()
	err := c.Invoke(func(
		bigdataController *controller.BigdataController,
	) {
		bigdataController.RegisterRouter(g)
	})
	fmt.Printf("RegisterBigdataRouters err: %+v\n", err)
}

func RegisterWriteRouters(g *gin.RouterGroup) {
	c := di.InjectInstance()
	err := c.Invoke(func(
		writeController *controller.WriteController,
	) {
		writeController.RegisterRouter(g)
	})
	fmt.Printf("RegisterWriteRouters err: %+v\n", err)
}

func RegisterOpptyRouters(g *gin.RouterGroup) {
	c := di.InjectInstance()
	err := c.Invoke(func(
		writeController *controller.OpptyController,
	) {
		writeController.RegisterRouter(g)
	})
	fmt.Printf("RegisterOpptyRouters err: %+v\n", err)
}

func RegisterAuthRouters(g *gin.RouterGroup) {
	c := di.InjectInstance()
	err := c.Invoke(func(
		authController *controller.AuthController,
	) {
		authController.RegisterRouter(g)
	})
	fmt.Printf("RegisterWriteRouters err: %+v\n", err)
}
